const path = require("path")
module.exports = {
    mode: "development",
    entry: "./src/index.js",
    output: {
        path: path.resolve(__dirname, "dist"),
        filename: "bundle.js"
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: {
                    loader: "babel-loader",
                    options: {
                        // 引入自己编写的插件
                        plugins: [[path.resolve(__dirname, "import.js"), {
                            // 指定要按需加载的模块
                            "libraryName": "lodash",
                            // 按需加载的目录, 默认是 lib, 如果不在 lib下, 则在这里写 打包的方法路径
                            "libraryDirectory": ""
                            // "camel2DashComponentName": false  // default: true
                        }]
                        ]
                    }
                }
            }
        ]
    }
}